package codepulse.blogmoon.cn.code.process;

import jakarta.annotation.Resource;
import org.springframework.stereotype.Component;

import java.util.List;
import java.util.Objects;

@Component
public class CodeProcessFactory {

    @Resource
    private List<CodeAccountProcess> codeAccountProcessList;


    public CodeAccountProcess getAccountProcess(Integer source) {
        return codeAccountProcessList.stream()
                .filter(p -> Objects.equals(source, p.getSource().getType()))
                .findFirst().orElse(null);
    }
}
